﻿using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using MSocketCore.Hub;
using SuperSocket.Command;

namespace MSocketCore.MSocket
{
    [MyCmdFilter]
    [Command(Key = "EE")]
    public class AFNEE : IAsyncCommand<MySession,MyPackage>
    {
        private readonly ILogger<AFNEE> _logger;

        public AFNEE(ILogger<AFNEE> logger)
        {
            _logger = logger;
        }

        private readonly MessageClient _client;

        public AFNEE(MessageClient client)
        {
            _client = client;
        }

        public ValueTask ExecuteAsync(MySession session, MyPackage info)
        {
            _logger.LogInformation($"App Recevice:[ERROR]"+ info.Message);

            //_client.SendMessage("aa", "ddd");
            //var name = UserDAL.GetUserIdBySn(info.Sn);
            //switch (info._Fn)
            //{
            //    case 1:
            //        _client.SendMessage(name, info.Sn + "操作成功" + "\n");
            //        break;
            //    case 2:
            //        _client.SendMessage(name, info.Sn + "操作失败" + "\n");
            //        break;
            //}

            return new ValueTask();
        }
    }
}
